home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 1
/
Cream of the Crop 1.iso
/
BUSINESS
/
SALE24.ARJ
/
READTEST.PRG
< prev
next >
Wrap
Text File
|
1992-06-01
|
2KB
|
79 lines
* PROCEDURE ReadTest
HIDE WINDOWS ALL
@0,0 FILL TO SROWS(), SCOLS() COLOR SCHEME 5
SET SYSMENU AUTO
SET TALK OFF
SET ESCAPE OFF
* pick a file, any file...
USE ?
IF EMPTY(ALIAS())
RETURN
ENDIF
* let's set up an attractive test screen
BROWSE SAVE NOWAIT TITLE "Browse Window"
ACTIVATE WINDOW Calculator
MOVE WINDOW Calculator TO 7,55
ZOOM WINDOW Browse NORM AT 16,1 SIZE 5,50
DEFINE WIND Readwind1 ;
FROM 5,1 TO 8,50 TITLE "Read1"
DEFINE WIND Readwind2 ;
FROM 10,1 TO 13,50 TITLE "Read2"
ACTIVATE WINDOW Readwind1
@ 0,2 EDIT x ;
DEFAULT REPL("One test. ",8) SIZE 2,44
ACTIVATE WINDOW Readwind2
@ 0,2 EDIT y ;
DEFAULT REPL("2nd test. ",9) SIZE 2,44
WAIT WINDOW ;
"Pick different windows different ways "+ ;
"or press F2; ESC to end."
PUSH KEY CLEAR
* if you have a macro assigned to F2, change the
* ON KEY LABEL F2 to some more convenient key
ON KEY LABEL F2 DO ReadTrial ;
WITH "ON KEY LABEL"
READ CYCLE ;
ACTIVATE ReadTrial("Activate",.t.) ;
DEACTIVATE ReadTrial("Deactivate",.f.) ;
WHEN ReadTrial("When",.t.) ;
VALID ReadTrial("Valid",LASTKEY()= 27) ;
SHOW ReadTrial("Show", .t.)
* While the READ remains in force, all its
* clauses as well as the ON KEY LABEL will
* call ReadTrial() to let us know what happened
* and the all-important sequence of events.
POP KEY
RELEASE WINDOWS "Browse", Readwind1, Readwind2
SET COLOR OF SCHEME 5 TO
SHOW WINDOWS ALL
DEACTIVATE WINDOW Calculator
RETURN
FUNCTION ReadTrial
PARAMETER whichclause, howreturn
* set up a string to tell us what happened
whatcalls = whichclause + ;
IIF(PARAMETERS() = 2, ;
" clause", " event")
* the color of the WAIT WINDOW uses SCHEME 5
* -- this is just an additional clue to
* what event occurred
SET COLOR OF SCHEME 5 TO SCHEME;
IIF(PARAMETERS() = 2,10,7)
WAIT WINDOW whatcalls+ ;
" -- Current: "+ WONTOP()+;
", Past: "+ WLAST() + ;
" Get: "+ VARREAD()+ ;
"(" + ALLTRIM(STR(_CUROBJ))+")"
RETURN howreturn